﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="B10PopupCenter.aspx.vb" Inherits="B10PopupCenter" %>
 
 

<%@ Register Assembly="ISNet.WebUI.WebTreeView" Namespace="ISNet.WebUI.WebTreeView" TagPrefix="ISWebTreeView" %>

<%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %>

<%@ Register Assembly="ISNet.WebUI.WebCombo" Namespace="ISNet.WebUI.WebCombo" TagPrefix="ISWebCombo" %>

<%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop" TagPrefix="ISWebDesktop" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="css/style.css" rel="stylesheet" />
       <script type="text/javascript">

           var code_maxP;
           var code_maxD;



           function WebCombo3_OnAfterItemSelected() {
               try {

                   var code_combo = ISGetObject("WebCombo3");
                   var comborow = code_combo.GetSelectedRow();

                   code_maxP = comborow.cells[2].innerText;
                   code_maxD = comborow.cells[3].innerText;
                   var pcode = document.getElementById("ProjectCode");
                   var p_radio = document.getElementById("RadioButton1");
                   if (p_radio.checked) {
                       pcode.value = code_maxP;
                   }
                   else {
                       pcode.value = code_maxD;
                   }
               } catch (err) { }
           }

           function radioselect() {
               try {
                   var pcode = document.getElementById("ProjectCode");
                   var p_radio = document.getElementById("RadioButton1");
                   if (p_radio.checked) {
                       if (typeof code_maxP != "undefined") {
                           pcode.value = code_maxP;
                       }
                       else {
                           pcode.value = '';
                       }
                   }
                   else {
                       if (typeof code_maxD != "undefined") {
                           pcode.value = code_maxD;
                       }
                       else {
                           pcode.value = '';
                       }
                   }
               } catch (err) { }
           }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <script>
            
            var dfctr = new Array();
            var dmaxP = new Array();
            var dmaxD = new Array();
            <%= dmax%>
        </script>
        <div style="text-align: right; float: left; width: 97%; margin-left: 6px; border: solid; border-color: gray; border-width: 1px; margin-top: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">


            <table style="float: right;">
                <tr>
                    <td>
                        <asp:ImageButton ID="SaveBtn" runat="server" ImageUrl="Icons/save.jpg" />
                        &nbsp;<asp:ImageButton ID="CancelBtn" runat="server" ImageUrl="Icons/cancel.png" />
                    </td>
                </tr>
            </table>
        </div>
        <br />
        <br />
        <div style="float: left; width: 97%; border: solid; margin-left: 6px; border-color: gray; border-width: 1px; margin-top: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; box-shadow: 5px 5px 5px #808080; padding: 5px 5px 5px 5px;">


            <div align="center" style="text-align: left;">
                <table align="center">

                    <tr>

                        <td>รหัสหน่วยงาน ของโครงการ/งานสนับสนุน

                        </td>
                        <td>
                            <ISWebCombo:WebCombo ID="WebCombo3" Width="200px" runat="server" UseDefaultStyle="True" DataTextField="Description" DataValueField="FundCenterCode" Height="20px" OnInitializeDataSource="WebCombo3_InitializeDataSource" AdditionalSearchFields="FundCenterCode" AllowWildCardSearch="true">
                                <LayoutSettings AlwaysShowAllRowsOnDropdown="true" AlwaysShowHelpButton="false" ComboMode="MultipleColumns">
                                    <ClientSideEvents OnAfterItemSelected="WebCombo3_OnAfterItemSelected" />
                                </LayoutSettings>
                                <Columns>
                                    <ISWebCombo:WebComboColumn BaseFieldName="Description" Name="Description" HeaderText="ชื่อ FundCenter" Width="250px" />
                                    <ISWebCombo:WebComboColumn BaseFieldName="FundCenterCode" Name="FundCenterCode" HeaderText="รหัส FundCenter" Width="80px" />
                                    <ISWebCombo:WebComboColumn BaseFieldName="MaxCodeP" Name="MaxCodeP" HeaderText="รหัสใหม่โครงการ" Width="0px" Hidden="true" RenderOnHidden="true" />
                                    <ISWebCombo:WebComboColumn BaseFieldName="MaxCodeD" Name="MaxCodeD" HeaderText="รหัสใหม่งานสนับสนุน" Width="0px" Hidden="true" RenderOnHidden="true" />
                                </Columns>
                            </ISWebCombo:WebCombo>

                        </td>

                    </tr>
                    <tr>
                        <td>ประเภท
                        </td>
                        <td>
                            <asp:RadioButton ID="RadioButton1" runat="server" Text="โครงการ" GroupName="radio1" Checked="true" />
                            <asp:RadioButton ID="RadioButton2" runat="server" Text="งานสนับสนุน" GroupName="radio1" />
                        </td>
                    </tr>
                    <tr>

                        <td>
                            <asp:Label runat="server" Text="รหัสโครงการ/งานสนับสนุน" ID="Label1"></asp:Label>

                        </td>
                        <td>
                            <asp:TextBox ID="ProjectCode" runat="server" Width="200px"></asp:TextBox>



                        </td>
                    </tr>
                    <tr>

                        <td>ชื่อโครงการ/งานสนับสนุน

                        </td>
                        <td>
                            <asp:TextBox ID="ProjectName" runat="server" Width="200px" MaxLength="40"></asp:TextBox>



                        </td>
                    </tr>
                    <tr>

                        <td>ชื่อโครงการ/งานสนับสนุนแบบสั้น

                        </td>
                        <td>
                            <asp:TextBox ID="ShortProj" runat="server" Width="100px" MaxLength="20"></asp:TextBox>



                        </td>

                    </tr>
                    <tr>

                        <td>
                            <asp:Label runat="server" Text="LabelPY1" ID="LabelPY1"></asp:Label>

                        </td>
                        <td>
                            <asp:TextBox ID="PY1" runat="server" Width="100px"></asp:TextBox>



                        </td>

                    </tr>
                    <tr>

                        <td>
                            <asp:Label runat="server" Text="LabelPY2" ID="LabelPY2"></asp:Label>

                        </td>
                        <td>
                            <asp:TextBox ID="PY2" runat="server" Width="100px"></asp:TextBox>



                        </td>

                    </tr>
                    <tr>

                        <td>
                            <asp:Label runat="server" Text="LabelPY3" ID="LabelPY3"></asp:Label>

                        </td>
                        <td>
                            <asp:TextBox ID="PY3" runat="server" Width="100px"></asp:TextBox>



                        </td>

                    </tr>
                    <tr>

                        <td>
                            <asp:Label runat="server" Text="LabelPY4" ID="LabelPY4"></asp:Label>

                        </td>
                        <td>
                            <asp:TextBox ID="PY4" runat="server" Width="100px"></asp:TextBox>



                        </td>

                    </tr>
                </table>

            </div>
        </div>
        <script>

            var combo1 = document.getElementById("WebCombo3");
            combo1.style.height = "20px";



        </script>
        <%= ScriptTxt %>
        <style>
            .WC4-DD-N {
                height: 0px;
            }

            .WC4-DD-A {
                height: 0px;
            }
        </style>
    </form>
</body>
</html>
